import {Tree} from 'antd';
import React from 'react'

const {TreeNode} = Tree;

export default class Demo extends React.Component {

  render() {
    return (
      <Tree showLine defaultExpandedKeys={['0-0-0']} onSelect={(selectedKeys, info) => {
        console.log('selected', selectedKeys, info)
      }}>

        <TreeNode title="第一章" key="0-0">
          <TreeNode title="第1节" key="0-0-0" isLeaf/>
          <TreeNode title="第2节" key="0-0-1" isLeaf/>
        </TreeNode>
        <TreeNode title="第二章" key="0-1">
          <TreeNode title="第1节" key="0-1-0" isLeaf/>
          <TreeNode title="第2节" key="0-1-1" isLeaf/>
          <TreeNode title="第3节" key="0-1-2" isLeaf/>
          <TreeNode title="第4节" key="0-1-3" isLeaf/>
        </TreeNode>
        <TreeNode title="第三章" key="0-2">
          <TreeNode title="第1节" key="0-2-0" isLeaf/>
          <TreeNode title="第2节" key="0-2-1" isLeaf/>
        </TreeNode>
      </Tree>
    );
  }
}
